<div>
    <h2>Spring Cloud Configuration</h2>

    <p>
        <form name="form" role="form" novalidate ng-submit="vm.refresh()" show-validation>
            <strong>Application: </strong>
            <input type="text" ng-model="vm.application" required class="form-control" uib-typeahead="app for app in vm.applicationList" typeahead-min-length="0" ng-click="vm.clearApplication()">

            <strong>Profile: </strong><input type="text" ng-model="vm.profile" required class="form-control">
            <p ng-hide="vm.isNative">
                <strong>Git Label: </strong>
                <input type="text" ng-model="vm.label" required class="form-control">
            </p>
            <button type="button" ng-disabled="form.$invalid" class="btn btn-primary" ng-click="vm.refresh()"><span class="glyphicon glyphicon-refresh"></span>&nbsp;<span>Refresh</span></button>
        </form>
    </p>

    <h3>Configuration</h3>
    <div hljs hljs-source="vm.data" hljs-language="yaml"></div>

    <h3>Configuration Source Information</h3>

    <table class="table table-striped ">
        <thead>
        <tr>
            <th>Type</th>
            <th ng-if="!vm.isNative">Repository URI</th>
            <th>Location</th>
        </tr>
        </thead>
        <tbody>
        <tr ng-if="vm.isNative" >
            <td>Native (Local Filesystem)</td>
            <td>{{ vm.nativeSearchLocation }}</td>
        </tr>
        <tr ng-if="!vm.isNative" >
            <td>Git</td>
            <td>{{ vm.gitUri }}</td>
            <td>/{{ vm.gitSearchLocation }}</td>
        </tr>
        </tbody>
    </table>
</div>
